//  -----------------------------------------------------------------------------------------------//
//   This file is part of SvnExternalUpdater                                                               //
//   Copyright (C)2008 Romain Verdier ( romain@codingly.com )                                      //
//                                                                                                 //
//   This program is free software; you can redistribute it and/or modify it under the terms       //
//   of the GNU General Public License as published by the Free Software Foundation; either        //
//   version 2 of the License, or (at your option) any later version. This program is distributed  //
//   in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied        //
//   warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public  //
//   License for more details.                                                                     //
//                                                                                                 //
//   You should have received a copy of the GNU General Public License along with this program; if //
//   not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. or  //
//   see http://www.fsf.org/licensing/licenses/gpl.html                                            //
//  -----------------------------------------------------------------------------------------------//
using System;
using System.Collections.Generic;

namespace Codingly.SvnExternalUpdater.Core
{
	public class LocalFolderInfo
	{
		private readonly string externalPropertyValue;
		private readonly List<string> externalReferences = new List<string>();
		private readonly Uri repositoryRootUrl;
		private readonly long revision;
		private readonly Uri url;

		public LocalFolderInfo(Uri url, long revision, Uri repositoryRootUrl, string externalProperty)
		{
			this.url = url;
			this.repositoryRootUrl = repositoryRootUrl;
			this.revision = revision;
			this.externalPropertyValue = externalProperty;
			if (this.externalPropertyValue != null)
			{
				this.externalReferences = new List<string>(this.externalPropertyValue.Split(new[] {'\r', '\n'}, StringSplitOptions.RemoveEmptyEntries));
			}
		}

		public string ExternalPropertyValue
		{
			get { return this.externalPropertyValue; }
		}

		public IList<string> ExternalReferences
		{
			get { return this.externalReferences; }
		}

		public Uri RepositoryRootUrl
		{
			get { return this.repositoryRootUrl; }
		}

		public long Revision
		{
			get { return this.revision; }
		}

		public Uri Url
		{
			get { return this.url; }
		}
	}
}